#pragma once 
#include <iostream>
#include <fcntl.h>
#include "log.hpp"

void Setnonblock(int fd)
{
    int fl = fcntl(fd,F_GETFD);
    if(fl < 0)
    {
        lg(ERROR,"fcntl Error...");
    }
    fcntl(fd, F_SETFD, fl| O_NONBLOCK);

}